target:=bin/osa-record

install_path:=/opt/osa-record

install_scripts:=draw_image.m \
	gen_sqlite.sh \
	image_gallery.mk \
	osa-record-ui.glade \
	osa-record-ui.py \
	run.sh \
	schema.sql \
	sql2oct.sh \
	export_data.m \

install_scripts_full:=$(patsubst %,$(install_path)/%,$(install_scripts))

all: $(target)

$(target):src/osa-record
	mv $< $@

.PHONY:clean $(install_path)/osa-record

src/osa-record:
	$(MAKE) -C src osa-record

clean:
	rm -f $(target)
	$(MAKE) -C src

install:$(install_scripts_full) $(install_path)/osa-record

$(install_path)/osa-record:
	cp bin/osa-record $@

$(install_scripts_full):$(install_path)/%:bin/%
	cp $< $@

$(install_scripts_full) $(install_path)/osa-record:$(install_path)

$(install_path):
	mkdir -p $@
